package cn.edu.bjtu.toychange.entity;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;

/**
 * The persistent class for the message database table.
 * 
 */
@Entity
//@NamedQuery(name = "Message.findAll", query = "SELECT m FROM Message m")
public class Message implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int m_messageID;

	private String m_content;

	@Temporal(TemporalType.DATE)
	private Date m_mesTime;

	// bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name = "M_receiverID")
	private User user1;

	// bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name = "M_senderID")
	private User user2;

	public Message() {
	}

	public int getM_messageID() {
		return this.m_messageID;
	}

	public void setM_messageID(int m_messageID) {
		this.m_messageID = m_messageID;
	}

	public String getM_content() {
		return this.m_content;
	}

	public void setM_content(String m_content) {
		this.m_content = m_content;
	}

	public Date getM_mesTime() {
		return this.m_mesTime;
	}

	public void setM_mesTime(Date m_mesTime) {
		this.m_mesTime = m_mesTime;
	}

	public User getUser1() {
		return this.user1;
	}

	public void setUser1(User user1) {
		this.user1 = user1;
	}

	public User getUser2() {
		return this.user2;
	}

	public void setUser2(User user2) {
		this.user2 = user2;
	}

}